package com.example.designpatterns.Iterator;

import java.util.LinkedList;

public class ConcreteAggregate implements Aggregate {
    LinkedList<Object> list = new LinkedList<>();

    @Override
    public void add(Object obj) {
        list.add(obj);
    }

    @Override
    public void remove(Object obj) {
        this.remove(obj);
    }

    @Override
    public Iterator iterator() {
        return new ConcreteIterator(list);
    }
}

